home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 109
/
Vol 109.iso
/
games
/
free_sty.swf
/
scripts
/
DefineSprite_164
/
frame_47
/
DoAction.as
Wrap
Text File
|
2008-11-12
|
528b
|
18 lines
var vv = 15;
var mxx = _root.bg_mc.man._x + _root.bg_mc.man._width;
var myy = _root.bg_mc.man._y - _root.bg_mc.man._height;
var bxx = _root.zhu_array[_root.level][this.upn][0];
var byy = _root.zhu_array[_root.level][this.upn][1];
if((mxx - bxx) * (mxx - bxx) + (myy - byy) * (myy - byy) > this.vv * this.vv)
{
var jj = Math.atan2(byy - myy,bxx - mxx);
this._x += this.vv * Math.cos(jj);
this._y += this.vv * Math.sin(jj);
}
else
{
this._x = bxx;
this._y = byy;
this.gotoAndPlay("上爬d2");
}